#ifndef PLAYSLIDER_H
#define PLAYSLIDER_H

#include <QWidget>

namespace Ui {
class PlaySlider;
}

class PlaySlider : public QWidget
{
    Q_OBJECT

public:
    explicit PlaySlider(QWidget *parent = nullptr);
    ~PlaySlider();
    void setPlayStep(double stepRatio);
private:
    // 鼠标按下、移动、释放事件
    void mousePressEvent(QMouseEvent* event);
    void mouseReleaseEvent(QMouseEvent* event);
    void mouseMoveEvent(QMouseEvent* event);
    void moveSlider();  // 改变outLine的geometry

signals:
    void setPlayProgress(double playRation);
private:
    Ui::PlaySlider *ui;
    int playGrogress; // 记录当前播放长度
};

#endif // PLAYSLIDER_H
